package com.daoyin.ssph.service.impl;

import java.util.List;

import com.daoyin.ssph.bean.Message;
import com.daoyin.ssph.dao.MessageDAO;
import com.daoyin.ssph.service.MessageService;


public class MessageServiceImpl extends BaseServiceImpl<Message> implements MessageService{
	private MessageDAO dao;

	public void setDao(MessageDAO dao) {
		this.dao = dao;
	}
	@SuppressWarnings("unchecked")
	public List<Message> query(){
		List<Message> list = dao.findAll();
		return list;	
	}
	public String add(Message message){
		dao.save(message);
		return "success";		
	}
	
	public Message query(Integer id){
		Message message = dao.findById(id);
		return message;	
	}
	public void delete(Integer id){
		Message message = dao.findById(id);
		dao.delete(message);
	}
}
